package paketGUI;

import java.util.HashMap;

import paketDB.DatabaseHandler;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import eu.mvmnt.golfingapp.R;

public class RegisteredScreen extends Activity implements OnClickListener {
	private Button backToLogin;

	@Override
	public void onClick(View v) {
		Intent intentLogin = new Intent(v.getContext(), LoginScreen.class);
		startActivityForResult(intentLogin, 0);
		finish();
	}

	@SuppressWarnings("rawtypes")
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.registered);
		DatabaseHandler db = new DatabaseHandler(getApplicationContext());
		HashMap user = new HashMap();
		user = db.getUserDetails();

		final TextView fname = (TextView) findViewById(R.id.txtRegisteredFirstName2);
		final TextView lname = (TextView) findViewById(R.id.txtRegisteredLastName2);
		final TextView email = (TextView) findViewById(R.id.txtRegisteredEmail2);
		final TextView createdat = (TextView) findViewById(R.id.txtCreatedAt2);
		fname.setText((CharSequence) user.get("Vorname")); //$NON-NLS-1$
		lname.setText((CharSequence) user.get("Nachname")); //$NON-NLS-1$
		email.setText((CharSequence) user.get("Email")); //$NON-NLS-1$
		createdat.setText((CharSequence) user.get("CreatedAt")); //$NON-NLS-1$

		backToLogin = (Button) findViewById(R.id.btnRegisteredBackToLogin);

		backToLogin.setOnClickListener(this);

	}
}
